﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:BaseLibrary.Power" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">

    <Style TargetType="{x:Type local:PowerWatcherVisual}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:PowerWatcherVisual}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}" d:DesignWidth="88" d:DesignHeight="88">
                    	<Grid Height="Auto" Width="Auto">
                    		<Grid.ColumnDefinitions>
                    			<ColumnDefinition Width="0.3*"/>
                    			<ColumnDefinition Width="0.282*"/>
                    			<ColumnDefinition Width="0.3*"/>
                    		</Grid.ColumnDefinitions>
                    		<Grid Margin="3,10,3,3" Grid.ColumnSpan="3">
                    			<Grid x:Name="batteryGrid" Margin="0,10,0,0">
                    				<Grid.ColumnDefinitions>
                    					<ColumnDefinition Width="0.25*"/>
                    					<ColumnDefinition Width="0.56*"/>
                    					<ColumnDefinition Width="0.25*"/>
                    				</Grid.ColumnDefinitions>
                    				<Grid.RowDefinitions>
                    					<RowDefinition x:Name="batteryEmptyRow" Height="0.4*"/>
                    					<RowDefinition x:Name="batteryFillRow" Height="0.6*"/>
                    				</Grid.RowDefinitions>
                    				<Rectangle x:Name="batteryBackground" Fill="#FF5AFF00" Stroke="{x:Null}" Grid.RowSpan="1" Grid.Row="1" Grid.ColumnSpan="3"/>
                    				<Rectangle Stroke="{x:Null}" HorizontalAlignment="Stretch" Margin="0" Width="Auto" Grid.Row="1" d:IsLocked="True">
                    					<Rectangle.Fill>
                    						<LinearGradientBrush EndPoint="0.212,0.5" StartPoint="0.701,0.5">
                    							<GradientStop Color="#4CFFFFFF" Offset="0"/>
                    							<GradientStop Color="#CCFFFFFF" Offset="1"/>
                    						</LinearGradientBrush>
                    					</Rectangle.Fill>
                    				</Rectangle>
                    				<Rectangle Height="Auto" Stroke="{x:Null}" Width="Auto" HorizontalAlignment="Stretch" Margin="0" Grid.Column="2" Grid.Row="1" d:IsHidden="True">
                    					<Rectangle.Fill>
                    						<LinearGradientBrush EndPoint="0.722,0.5" StartPoint="0.278,0.5">
                    							<GradientStop Color="#4CFFFFFF" Offset="0"/>
                    							<GradientStop Color="#CCFFFFFF" Offset="1"/>
                    						</LinearGradientBrush>
                    					</Rectangle.Fill>
                    				</Rectangle>
                    				<TextBlock x:Name="batteryPercent" Margin="0" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Center" Grid.RowSpan="2" Grid.Column="1"><Run Text="49 %"/></TextBlock>
                    				<Grid x:Name="batterySymbol" Grid.RowSpan="1" VerticalAlignment="Bottom" HorizontalAlignment="Right" Grid.Column="0" Grid.Row="1" Margin="-17.377,0,2,2" d:LayoutOverrides="Width" Grid.ColumnSpan="3">
                    					<TextBlock Margin="0" TextWrapping="Wrap" Text="Battery" VerticalAlignment="Top" d:LayoutOverrides="Width"/>
                    				</Grid>
                    				<Grid x:Name="usbSymbol" Grid.RowSpan="1" VerticalAlignment="Bottom" HorizontalAlignment="Right" Grid.Row="1" Grid.Column="0" Margin="-1.337,0,2,2" d:LayoutOverrides="Width" Grid.ColumnSpan="3">
                    					<TextBlock Margin="0" TextWrapping="Wrap" Text="USP" VerticalAlignment="Top" d:LayoutOverrides="Width"/>
                    				</Grid>
                    			</Grid>
                    		</Grid>
                    		<Rectangle Stroke="Black" StrokeThickness="3" Margin="0,10,0,0" Grid.ColumnSpan="3" d:IsHidden="True"/>
                    		<Rectangle Stroke="Black" StrokeThickness="3" Fill="Black" VerticalAlignment="Top" Height="10" HorizontalAlignment="Stretch" Grid.Column="1" d:IsHidden="True"/>
                    		<local:PowerWatcher x:Name="powerWatcher" Margin="0,0,-69.81,0" VerticalAlignment="Top" d:LayoutOverrides="Width" d:IsHidden="True" Grid.ColumnSpan="3"/>
                    	</Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
